package com.yonyou.biz.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;

import java.util.*;

import static com.yonyou.demo.CtmDemo.getAllJavaFilePaths;

import com.yonyou.component.DelFileProcess;
import org.apache.commons.collections.CollectionUtils;

public class DelFile extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {

        Project project = e.getData(PlatformDataKeys.PROJECT);
        List<VirtualFile> vFiles=getAllJavaFilePaths();
        if(CollectionUtils.isEmpty(vFiles)){
            com.yonyou.ctm.ctmplugin.utils.NotificationUtil.showDialog("异常","未找到文件");
            return;
        }
        ProgressManager.getInstance().run(new DelFileProcess(vFiles,project, "删除中"));

    }



}
